﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using LingDong.PictureKeywords;
using NLog;
using LingDong.NaiveCrawler;

namespace LingDong.PictureKeywordsExample
{
    class PictureCrawlTest
    {
        internal static void DownloadImage()
        {
            string[] files = Directory.GetFiles(inputHTMLDir);

            int total = files.Length;
            for (int i = 0; i < total; i++)
            {
                string content = PictureKeywordsTest.GetNewsContent(files[i]);
                PictureCrawl.CrawlHTML(content, files[i], outputImageDir);

                logger.Debug(i.ToString());
            }
        }

        private static string inputHTMLDir = @"F:\LingDongData\WebPage\News\";
        private static string outputImageDir = @"F:\LingDongData\WebPage\Pics\";

        private static Logger logger = LogManager.GetCurrentClassLogger();
    }
}
